package com.xuelang.pipeline.worker.app.pod;

import com.xuelang.pipeline.worker.client.pod.dto.PodQueryDTO;
import com.xuelang.pipeline.worker.client.pod.dto.QueryDTO;
import io.kubernetes.client.openapi.models.V1PodList;
import org.springframework.web.socket.WebSocketSession;

import java.io.InputStream;

/**
 * @author liuyuan.ly
 * @since 2024/5/29 9:47
 */
public interface PodService {

    /**
     * @param queryDTO
     * @return
     */
    V1PodList getPodList(QueryDTO queryDTO);


    String  getPodLog(PodQueryDTO queryDTO);

    /**
     * 流式获取日志
     * @param queryDTO
     * @param session
     */
    void streamPodLog(PodQueryDTO queryDTO, WebSocketSession session);

    /**
     * 流式获取日志流
     * @param queryDTO
     * @return
     */
    InputStream streamPodLog(PodQueryDTO queryDTO);
}
